
#ifndef __TS_PROTOCOL_H_
#define __TS_PROTOCOL_H_

#include "mqtt.h"
#include <stdio.h>
#include <stddef.h>
#include <stdbool.h>

void *protocol_device_get_mqtt(void *ptr);
void *protocol_interface_get_mqtt(void *ptr);
void *protocol_point_get_mqtt(void *pit);
void *protocol_interface_to_str(void *ifa);
void *protocol_point_to_str(void *pit);
void *protocol_software_all_to_str(void *obj);
void *protocol_device_to_str(void *obj);
bool protocol_parse_control(const char *data, int64_t *id_p,
    int64_t *ctl_id_p, char **value_p);
void *protocol_node_to_str(void *ptr);
void *protocol_point_ctl(int64_t id, int64_t ctl_id,
    const char *key, const char *value);
void *protocol_interface_to_root_node2(void *ifa, void **ifa_node_p);
char *protocol_time_str_from_timestamp(int64_t timestamp);
char *protocol_encode_control_V4(int64_t id1, int64_t id2, int64_t id3,
    int64_t id4);
int protocol_decode_controlV4(const char *msg,
    int64_t *id1_p, int64_t *id2_p, int64_t *id3_p, int64_t *id4_p);
bool protocol_update_object(const char *data, void *object);
#endif //__TS_PROTOCOL_H_
